home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
calendar
/
cal
/
cal.frm
< prev
next >
Wrap
Text File
|
1995-10-24
|
29KB
|
970 lines
VERSION 2.00
Begin Form Cal
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
ClientHeight = 4065
ClientLeft = 3615
ClientTop = 1920
ClientWidth = 3480
Height = 4470
Icon = CAL.FRX:0000
Left = 3555
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4065
ScaleWidth = 3480
Top = 1575
Width = 3600
Begin CommandButton Command3
Caption = "&Cancel"
Height = 315
Left = 1860
TabIndex = 53
Top = 3660
Width = 1095
End
Begin CommandButton Command2
Caption = "O&K"
Height = 315
Left = 540
TabIndex = 52
Top = 3660
Width = 1155
End
Begin VScrollBar VScroll1
Height = 495
Left = 3180
Max = 1492
Min = 2050
TabIndex = 48
TabStop = 0 'False
Top = 3000
Value = 1492
Width = 255
End
Begin CommandButton Command1
Caption = "Dec"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 11
Left = 1920
TabIndex = 47
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
Caption = "Nov"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 10
Left = 1560
TabIndex = 46
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "Oct"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 9
Left = 1200
TabIndex = 45
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
Caption = "Sep"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 8
Left = 840
TabIndex = 44
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
Caption = "Aug"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 7
Left = 480
TabIndex = 43
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
Caption = "Jul"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 6
Left = 120
TabIndex = 42
TabStop = 0 'False
Top = 3240
Width = 375
End
Begin CommandButton Command1
Caption = "Jun"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 5
Left = 1920
TabIndex = 41
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin CommandButton Command1
Caption = "May"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 4
Left = 1560
TabIndex = 40
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin CommandButton Command1
Caption = "Apr"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 3
Left = 1200
TabIndex = 39
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin CommandButton Command1
Caption = "Mar"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 2
Left = 840
TabIndex = 38
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin CommandButton Command1
Caption = "Feb"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 1
Left = 480
TabIndex = 37
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin CommandButton Command1
BackColor = &H00C0C0C0&
Caption = "Jan"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 0
Left = 120
TabIndex = 36
TabStop = 0 'False
Top = 2940
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 36
Left = 720
TabIndex = 50
Top = 2400
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 35
Left = 300
TabIndex = 51
Top = 2400
Width = 375
End
Begin Label Label3
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 2400
TabIndex = 49
Top = 3120
Width = 675
End
Begin Shape Shape2
Height = 435
Left = 120
Top = 60
Width = 3255
End
Begin Shape Shape1
Height = 2295
Left = 120
Top = 540
Width = 3255
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = " Sun Mon Tue Wed Thu Fri Sat"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 255
Left = 300
TabIndex = 0
Top = 180
Width = 2955
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 34
Left = 2820
TabIndex = 1
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 33
Left = 2400
TabIndex = 2
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 32
Left = 1980
TabIndex = 3
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 31
Left = 1560
TabIndex = 4
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 30
Left = 1140
TabIndex = 5
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 29
Left = 720
TabIndex = 6
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 28
Left = 300
TabIndex = 7
Top = 2040
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 27
Left = 2820
TabIndex = 8
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 26
Left = 2400
TabIndex = 9
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 25
Left = 1980
TabIndex = 10
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 24
Left = 1560
TabIndex = 11
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 23
Left = 1140
TabIndex = 12
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 22
Left = 720
TabIndex = 13
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 21
Left = 300
TabIndex = 14
Top = 1680
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 20
Left = 2820
TabIndex = 15
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 19
Left = 2400
TabIndex = 16
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 18
Left = 1980
TabIndex = 17
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 17
Left = 1560
TabIndex = 18
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 16
Left = 1140
TabIndex = 19
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 15
Left = 720
TabIndex = 20
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 14
Left = 300
TabIndex = 21
Top = 1320
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 13
Left = 2820
TabIndex = 22
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 12
Left = 2400
TabIndex = 23
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 11
Left = 1980
TabIndex = 24
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 10
Left = 1560
TabIndex = 25
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 9
Left = 1140
TabIndex = 26
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 8
Left = 720
TabIndex = 27
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 7
Left = 300
TabIndex = 28
Top = 960
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 6
Left = 2820
TabIndex = 29
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 5
Left = 2400
TabIndex = 30
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 4
Left = 1980
TabIndex = 31
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 3
Left = 1560
TabIndex = 32
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 2
Left = 1140
TabIndex = 33
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00FFFFFF&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 315
Index = 1
Left = 720
TabIndex = 34
Top = 600
Width = 375
End
Begin Label Label1
Alignment = 2 'Center
BackColor = &H00FFFFFF&
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00000000&
Height = 315
Index = 0
Left = 300
TabIndex = 35
Top = 600
Width = 375
End
End
Option Explicit
Dim mi_day As Integer
Dim mi_month As Integer
Dim mi_year As Integer
Dim mi_previndex As Integer
Sub Command1_Click (index As Integer)
mi_month = index + 1
Call Fill_Box(index + 1, mi_year, mi_day)
Cal.Caption = Format$(DateValue(mi_month & "/" & mi_day & "/" & mi_year), "dddddd")
End Sub
Sub Command2_Click ()
Clipboard.SetText Cal.Caption, 1
Unload Cal
End Sub
Sub Command3_Click ()
Unload Cal
End Sub
Sub Fill_Box (xmon As Integer, xyear As Integer, xday As Integer)
Dim xm As Integer
Dim index As Integer
Dim xd As Integer
Dim xds As String
' Clear Boxes
For index = 0 To 36
Label1(index).Caption = ""
Next index
index = Format(DateValue(xmon & "/" & "01" & "/" & xyear), "w")
xd = 1
xm = xmon
Do While xm = xmon
Label1(index - 1) = xd
index = index + 1
xm = Format(DateValue(xmon & "/" & xd & "/" & xyear) + 1, "mm")
xd = xd + 1
Loop
If xday = 0 Then Exit Sub
'
' xday has the date we want to highlight
' figure out what the index is
'
index = Format(DateValue(xmon & "/" & "01" & "/" & xyear), "w")
If Label1(xday + (index - 2)).Caption <> "" Then
Call Label1_Click(xday + (index - 2))
Else
Call Label1_Click((index - 1))
End If
End Sub
Sub Form_Load ()
' Get Todays Date
mi_previndex = -1
mi_day = Format(Now, "dd")
mi_year = Format(Now, "yyyy")
mi_month = Format(Now, "mm")
Label3.Caption = mi_year
Vscroll1.Value = mi_year
Cal.Caption = mi_month & "/" & mi_day & "/" & mi_year
Call Fill_Box(10, CInt(Label3.Caption), mi_day)
End Sub
Sub Label1_Click (index As Integer)
If Label1(index).Caption = "" Then
Exit Sub
End If
If mi_previndex <> -1 Then
Label1(mi_previndex).BorderStyle = 0
Label1(mi_previndex).ForeColor = &H80000008
End If
mi_previndex = index
mi_day = CInt(Label1(index).Caption)
Label1(mi_previndex).BorderStyle = 1
Label1(mi_previndex).ForeColor = &HC000C0
Cal.Caption = Format$(DateValue(mi_month & "/" & mi_day & "/" & mi_year), "dddddd")
End Sub
Sub VScroll1_Change ()
Label3.Caption = Vscroll1.Value
mi_year = Vscroll1.Value
Call Fill_Box(mi_month, mi_year, mi_day)
Cal.Caption = Format$(DateValue(mi_month & "/" & mi_day & "/" & mi_year), "dddddd")
End Sub